<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:p="http://primefaces.org/ui"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:c="http://java.sun.com/jsp/jstl/core">
    
    <body>
        
        <ui:composition template="./../template.xhtml">
            
            <ui:define name="meta">
                
            </ui:define>

            <ui:define name="title">
                List Accept
            </ui:define>

            <ui:define name="content">

                <h:form>

                    <p:dataTable var="item" value="#{registrationController.itemsRegAccept}"
                                 paginator="true" rows="10" id="listAccept"
                                 paginatorTemplate="{CurrentPageReport}  {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
                                 rowsPerPageTemplate="5,10,15"
                                 style="font-size: 12px;">
                        <p:columnGroup type="header">
                            <p:row>
                                <p:column colspan="3" style="font-size: large;word-break:break-all;"
                                          headerText="#{registrationController.currentEvent.eventName}"/>
                            </p:row>
                            <p:row>
                                <p:column headerText="Username"/>
                                <p:column headerText="Reg Time"/>
                                <p:column headerText="Status"/>
                            </p:row>
                        </p:columnGroup>

                        <p:column style="width: 120px;" sortBy="#{item.userInfo.userName}" filterBy="#{item.userInfo.userName}">
                            <f:facet name="header">
                                <h:outputText value="UserName"/>
                            </f:facet>
                            <h:outputText value="#{item.userInfo.userName}" />
                        </p:column>

                        <p:column style="width: 120px;">
                            <f:facet name="header">
                                <h:outputText value="Reg Time"/>
                            </f:facet>
                            <h:outputText value="#{item.regTime}">
                                <f:convertDateTime pattern="MM/dd/yyyy" />
                            </h:outputText>
                        </p:column>

                        <p:column style="width: 120px;">
                            <f:facet name="header">
                                <h:outputText value="Status Reg"/>
                            </f:facet>
                            <h:outputText value="#{item.statusReg}" />
                        </p:column>

                        <p:columnGroup type="footer">
                            <p:row>
                                <p:column colspan="2" footerText="Totals:"/>
                                <p:column footerText="#{registrationController.itemsRegAccept.rowCount}"/>
                            </p:row>
                        </p:columnGroup>
                    </p:dataTable>
                    <p:panel header="Export All Data">
                        <p:commandButton value="Export as PDF" ajax="false" >
                                 <p:dataExporter type="pdf" target="listAccept" fileName="ListAccept"
                                                 preProcessor="#{registrationController.preProcessPDF}"/>
                        </p:commandButton>
                    </p:panel>
                </h:form>
            </ui:define>

        </ui:composition>
        
    </body>
</html>
